
/**
 * This is a generated class and is not intended for modification.  
 */
package valueObjects
{
import com.adobe.fiber.styles.IStyle;
import com.adobe.fiber.styles.Style;
import com.adobe.fiber.styles.StyleValidator;
import com.adobe.fiber.valueobjects.AbstractEntityMetadata;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import mx.events.ValidationResultEvent;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IModelType;
import mx.events.PropertyChangeEvent;

use namespace model_internal;

[ExcludeClass]
internal class _DoorsEntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata
{
    private static var emptyArray:Array = new Array();

    model_internal static var allProperties:Array = new Array("id", "en_UK_name", "en_UK_type", "de_AT_name", "de_AT_type", "url_drawing", "door_uValue");
    model_internal static var allAssociationProperties:Array = new Array();
    model_internal static var allRequiredProperties:Array = new Array("id", "en_UK_name", "en_UK_type", "de_AT_name", "de_AT_type", "url_drawing", "door_uValue");
    model_internal static var allAlwaysAvailableProperties:Array = new Array("id", "en_UK_name", "en_UK_type", "de_AT_name", "de_AT_type", "url_drawing", "door_uValue");
    model_internal static var guardedProperties:Array = new Array();
    model_internal static var dataProperties:Array = new Array("id", "en_UK_name", "en_UK_type", "de_AT_name", "de_AT_type", "url_drawing", "door_uValue");
    model_internal static var sourceProperties:Array = emptyArray
    model_internal static var nonDerivedProperties:Array = new Array("id", "en_UK_name", "en_UK_type", "de_AT_name", "de_AT_type", "url_drawing", "door_uValue");
    model_internal static var derivedProperties:Array = new Array();
    model_internal static var collectionProperties:Array = new Array();
    model_internal static var collectionBaseMap:Object;
    model_internal static var entityName:String = "Doors";
    model_internal static var dependentsOnMap:Object;
    model_internal static var dependedOnServices:Array = new Array();
    model_internal static var propertyTypeMap:Object;

    
    model_internal var _en_UK_nameIsValid:Boolean;
    model_internal var _en_UK_nameValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _en_UK_nameIsValidCacheInitialized:Boolean = false;
    model_internal var _en_UK_nameValidationFailureMessages:Array;
    
    model_internal var _en_UK_typeIsValid:Boolean;
    model_internal var _en_UK_typeValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _en_UK_typeIsValidCacheInitialized:Boolean = false;
    model_internal var _en_UK_typeValidationFailureMessages:Array;
    
    model_internal var _de_AT_nameIsValid:Boolean;
    model_internal var _de_AT_nameValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _de_AT_nameIsValidCacheInitialized:Boolean = false;
    model_internal var _de_AT_nameValidationFailureMessages:Array;
    
    model_internal var _de_AT_typeIsValid:Boolean;
    model_internal var _de_AT_typeValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _de_AT_typeIsValidCacheInitialized:Boolean = false;
    model_internal var _de_AT_typeValidationFailureMessages:Array;
    
    model_internal var _url_drawingIsValid:Boolean;
    model_internal var _url_drawingValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _url_drawingIsValidCacheInitialized:Boolean = false;
    model_internal var _url_drawingValidationFailureMessages:Array;

    model_internal var _instance:_Super_Doors;
    model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style();

    public function _DoorsEntityMetadata(value : _Super_Doors)
    {
        // initialize property maps
        if (model_internal::dependentsOnMap == null)
        {
            // dependents map
            model_internal::dependentsOnMap = new Object();
            model_internal::dependentsOnMap["id"] = new Array();
            model_internal::dependentsOnMap["en_UK_name"] = new Array();
            model_internal::dependentsOnMap["en_UK_type"] = new Array();
            model_internal::dependentsOnMap["de_AT_name"] = new Array();
            model_internal::dependentsOnMap["de_AT_type"] = new Array();
            model_internal::dependentsOnMap["url_drawing"] = new Array();
            model_internal::dependentsOnMap["door_uValue"] = new Array();

            // collection base map
            model_internal::collectionBaseMap = new Object();
        }

        // Property type Map
        model_internal::propertyTypeMap = new Object();
        model_internal::propertyTypeMap["id"] = "int";
        model_internal::propertyTypeMap["en_UK_name"] = "String";
        model_internal::propertyTypeMap["en_UK_type"] = "String";
        model_internal::propertyTypeMap["de_AT_name"] = "String";
        model_internal::propertyTypeMap["de_AT_type"] = "String";
        model_internal::propertyTypeMap["url_drawing"] = "String";
        model_internal::propertyTypeMap["door_uValue"] = "Number";

        model_internal::_instance = value;
        model_internal::_en_UK_nameValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForEn_UK_name);
        model_internal::_en_UK_nameValidator.required = true;
        model_internal::_en_UK_nameValidator.requiredFieldError = "en_UK_name is required";
        //model_internal::_en_UK_nameValidator.source = model_internal::_instance;
        //model_internal::_en_UK_nameValidator.property = "en_UK_name";
        model_internal::_en_UK_typeValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForEn_UK_type);
        model_internal::_en_UK_typeValidator.required = true;
        model_internal::_en_UK_typeValidator.requiredFieldError = "en_UK_type is required";
        //model_internal::_en_UK_typeValidator.source = model_internal::_instance;
        //model_internal::_en_UK_typeValidator.property = "en_UK_type";
        model_internal::_de_AT_nameValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForDe_AT_name);
        model_internal::_de_AT_nameValidator.required = true;
        model_internal::_de_AT_nameValidator.requiredFieldError = "de_AT_name is required";
        //model_internal::_de_AT_nameValidator.source = model_internal::_instance;
        //model_internal::_de_AT_nameValidator.property = "de_AT_name";
        model_internal::_de_AT_typeValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForDe_AT_type);
        model_internal::_de_AT_typeValidator.required = true;
        model_internal::_de_AT_typeValidator.requiredFieldError = "de_AT_type is required";
        //model_internal::_de_AT_typeValidator.source = model_internal::_instance;
        //model_internal::_de_AT_typeValidator.property = "de_AT_type";
        model_internal::_url_drawingValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForUrl_drawing);
        model_internal::_url_drawingValidator.required = true;
        model_internal::_url_drawingValidator.requiredFieldError = "url_drawing is required";
        //model_internal::_url_drawingValidator.source = model_internal::_instance;
        //model_internal::_url_drawingValidator.property = "url_drawing";
    }

    override public function getEntityName():String
    {
        return model_internal::entityName;
    }

    override public function getProperties():Array
    {
        return model_internal::allProperties;
    }

    override public function getAssociationProperties():Array
    {
        return model_internal::allAssociationProperties;
    }

    override public function getRequiredProperties():Array
    {
         return model_internal::allRequiredProperties;   
    }

    override public function getDataProperties():Array
    {
        return model_internal::dataProperties;
    }

    public function getSourceProperties():Array
    {
        return model_internal::sourceProperties;
    }

    public function getNonDerivedProperties():Array
    {
        return model_internal::nonDerivedProperties;
    }

    override public function getGuardedProperties():Array
    {
        return model_internal::guardedProperties;
    }

    override public function getUnguardedProperties():Array
    {
        return model_internal::allAlwaysAvailableProperties;
    }

    override public function getDependants(propertyName:String):Array
    {
       if (model_internal::nonDerivedProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a data property of entity Doors");
            
       return model_internal::dependentsOnMap[propertyName] as Array;  
    }

    override public function getDependedOnServices():Array
    {
        return model_internal::dependedOnServices;
    }

    override public function getCollectionProperties():Array
    {
        return model_internal::collectionProperties;
    }

    override public function getCollectionBase(propertyName:String):String
    {
        if (model_internal::collectionProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a collection property of entity Doors");

        return model_internal::collectionBaseMap[propertyName];
    }
    
    override public function getPropertyType(propertyName:String):String
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a property of Doors");

        return model_internal::propertyTypeMap[propertyName];
    }

    override public function getAvailableProperties():com.adobe.fiber.valueobjects.IPropertyIterator
    {
        return new com.adobe.fiber.valueobjects.AvailablePropertyIterator(this);
    }

    override public function getValue(propertyName:String):*
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity Doors");
        }

        return model_internal::_instance[propertyName];
    }

    override public function setValue(propertyName:String, value:*):void
    {
        if (model_internal::nonDerivedProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " is not a modifiable property of entity Doors");
        }

        model_internal::_instance[propertyName] = value;
    }

    override public function getMappedByProperty(associationProperty:String):String
    {
        switch(associationProperty)
        {
            default:
            {
                return null;
            }
        }
    }

    override public function getPropertyLength(propertyName:String):int
    {
        switch(propertyName)
        {
            default:
            {
                return 0;
            }
        }
    }

    override public function isAvailable(propertyName:String):Boolean
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity Doors");
        }

        if (model_internal::allAlwaysAvailableProperties.indexOf(propertyName) != -1)
        {
            return true;
        }

        switch(propertyName)
        {
            default:
            {
                return true;
            }
        }
    }

    override public function getIdentityMap():Object
    {
        var returnMap:Object = new Object();
        returnMap["id"] = model_internal::_instance.id;

        return returnMap;
    }

    [Bindable(event="propertyChange")]
    override public function get invalidConstraints():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_invalidConstraints;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_invalidConstraints;        
        }
    }

    [Bindable(event="propertyChange")]
    override public function get validationFailureMessages():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
    }

    override public function getDependantInvalidConstraints(propertyName:String):Array
    {
        var dependants:Array = getDependants(propertyName);
        if (dependants.length == 0)
        {
            return emptyArray;
        }

        var currentlyInvalid:Array = invalidConstraints;
        if (currentlyInvalid.length == 0)
        {
            return emptyArray;
        }

        var filterFunc:Function = function(element:*, index:int, arr:Array):Boolean
        {
            return dependants.indexOf(element) > -1;
        }

        return currentlyInvalid.filter(filterFunc);
    }

    /**
     * isValid
     */
    [Bindable(event="propertyChange")] 
    public function get isValid() : Boolean
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_isValid;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_isValid;
        }
    }

    [Bindable(event="propertyChange")]
    public function get isIdAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isEn_UK_nameAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isEn_UK_typeAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isDe_AT_nameAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isDe_AT_typeAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isUrl_drawingAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isDoor_uValueAvailable():Boolean
    {
        return true;
    }


    /**
     * derived property recalculation
     */
    public function invalidateDependentOnEn_UK_name():void
    {
        if (model_internal::_en_UK_nameIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfEn_UK_name = null;
            model_internal::calculateEn_UK_nameIsValid();
        }
    }
    public function invalidateDependentOnEn_UK_type():void
    {
        if (model_internal::_en_UK_typeIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfEn_UK_type = null;
            model_internal::calculateEn_UK_typeIsValid();
        }
    }
    public function invalidateDependentOnDe_AT_name():void
    {
        if (model_internal::_de_AT_nameIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfDe_AT_name = null;
            model_internal::calculateDe_AT_nameIsValid();
        }
    }
    public function invalidateDependentOnDe_AT_type():void
    {
        if (model_internal::_de_AT_typeIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfDe_AT_type = null;
            model_internal::calculateDe_AT_typeIsValid();
        }
    }
    public function invalidateDependentOnUrl_drawing():void
    {
        if (model_internal::_url_drawingIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfUrl_drawing = null;
            model_internal::calculateUrl_drawingIsValid();
        }
    }

    model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void
    {
        this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue));
    }

    [Bindable(event="propertyChange")]   
    public function get idStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get en_UK_nameStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get en_UK_nameValidator() : StyleValidator
    {
        return model_internal::_en_UK_nameValidator;
    }

    model_internal function set _en_UK_nameIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_en_UK_nameIsValid;         
        if (oldValue !== value)
        {
            model_internal::_en_UK_nameIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "en_UK_nameIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get en_UK_nameIsValid():Boolean
    {
        if (!model_internal::_en_UK_nameIsValidCacheInitialized)
        {
            model_internal::calculateEn_UK_nameIsValid();
        }

        return model_internal::_en_UK_nameIsValid;
    }

    model_internal function calculateEn_UK_nameIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_en_UK_nameValidator.validate(model_internal::_instance.en_UK_name)
        model_internal::_en_UK_nameIsValid_der = (valRes.results == null);
        model_internal::_en_UK_nameIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::en_UK_nameValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::en_UK_nameValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get en_UK_nameValidationFailureMessages():Array
    {
        if (model_internal::_en_UK_nameValidationFailureMessages == null)
            model_internal::calculateEn_UK_nameIsValid();

        return _en_UK_nameValidationFailureMessages;
    }

    model_internal function set en_UK_nameValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_en_UK_nameValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_en_UK_nameValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "en_UK_nameValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get en_UK_typeStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get en_UK_typeValidator() : StyleValidator
    {
        return model_internal::_en_UK_typeValidator;
    }

    model_internal function set _en_UK_typeIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_en_UK_typeIsValid;         
        if (oldValue !== value)
        {
            model_internal::_en_UK_typeIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "en_UK_typeIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get en_UK_typeIsValid():Boolean
    {
        if (!model_internal::_en_UK_typeIsValidCacheInitialized)
        {
            model_internal::calculateEn_UK_typeIsValid();
        }

        return model_internal::_en_UK_typeIsValid;
    }

    model_internal function calculateEn_UK_typeIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_en_UK_typeValidator.validate(model_internal::_instance.en_UK_type)
        model_internal::_en_UK_typeIsValid_der = (valRes.results == null);
        model_internal::_en_UK_typeIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::en_UK_typeValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::en_UK_typeValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get en_UK_typeValidationFailureMessages():Array
    {
        if (model_internal::_en_UK_typeValidationFailureMessages == null)
            model_internal::calculateEn_UK_typeIsValid();

        return _en_UK_typeValidationFailureMessages;
    }

    model_internal function set en_UK_typeValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_en_UK_typeValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_en_UK_typeValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "en_UK_typeValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get de_AT_nameStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get de_AT_nameValidator() : StyleValidator
    {
        return model_internal::_de_AT_nameValidator;
    }

    model_internal function set _de_AT_nameIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_de_AT_nameIsValid;         
        if (oldValue !== value)
        {
            model_internal::_de_AT_nameIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "de_AT_nameIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get de_AT_nameIsValid():Boolean
    {
        if (!model_internal::_de_AT_nameIsValidCacheInitialized)
        {
            model_internal::calculateDe_AT_nameIsValid();
        }

        return model_internal::_de_AT_nameIsValid;
    }

    model_internal function calculateDe_AT_nameIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_de_AT_nameValidator.validate(model_internal::_instance.de_AT_name)
        model_internal::_de_AT_nameIsValid_der = (valRes.results == null);
        model_internal::_de_AT_nameIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::de_AT_nameValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::de_AT_nameValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get de_AT_nameValidationFailureMessages():Array
    {
        if (model_internal::_de_AT_nameValidationFailureMessages == null)
            model_internal::calculateDe_AT_nameIsValid();

        return _de_AT_nameValidationFailureMessages;
    }

    model_internal function set de_AT_nameValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_de_AT_nameValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_de_AT_nameValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "de_AT_nameValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get de_AT_typeStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get de_AT_typeValidator() : StyleValidator
    {
        return model_internal::_de_AT_typeValidator;
    }

    model_internal function set _de_AT_typeIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_de_AT_typeIsValid;         
        if (oldValue !== value)
        {
            model_internal::_de_AT_typeIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "de_AT_typeIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get de_AT_typeIsValid():Boolean
    {
        if (!model_internal::_de_AT_typeIsValidCacheInitialized)
        {
            model_internal::calculateDe_AT_typeIsValid();
        }

        return model_internal::_de_AT_typeIsValid;
    }

    model_internal function calculateDe_AT_typeIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_de_AT_typeValidator.validate(model_internal::_instance.de_AT_type)
        model_internal::_de_AT_typeIsValid_der = (valRes.results == null);
        model_internal::_de_AT_typeIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::de_AT_typeValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::de_AT_typeValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get de_AT_typeValidationFailureMessages():Array
    {
        if (model_internal::_de_AT_typeValidationFailureMessages == null)
            model_internal::calculateDe_AT_typeIsValid();

        return _de_AT_typeValidationFailureMessages;
    }

    model_internal function set de_AT_typeValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_de_AT_typeValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_de_AT_typeValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "de_AT_typeValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get url_drawingStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get url_drawingValidator() : StyleValidator
    {
        return model_internal::_url_drawingValidator;
    }

    model_internal function set _url_drawingIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_url_drawingIsValid;         
        if (oldValue !== value)
        {
            model_internal::_url_drawingIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "url_drawingIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get url_drawingIsValid():Boolean
    {
        if (!model_internal::_url_drawingIsValidCacheInitialized)
        {
            model_internal::calculateUrl_drawingIsValid();
        }

        return model_internal::_url_drawingIsValid;
    }

    model_internal function calculateUrl_drawingIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_url_drawingValidator.validate(model_internal::_instance.url_drawing)
        model_internal::_url_drawingIsValid_der = (valRes.results == null);
        model_internal::_url_drawingIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::url_drawingValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::url_drawingValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get url_drawingValidationFailureMessages():Array
    {
        if (model_internal::_url_drawingValidationFailureMessages == null)
            model_internal::calculateUrl_drawingIsValid();

        return _url_drawingValidationFailureMessages;
    }

    model_internal function set url_drawingValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_url_drawingValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_url_drawingValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "url_drawingValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get door_uValueStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }


     /**
     * 
     * @inheritDoc 
     */ 
     override public function getStyle(propertyName:String):com.adobe.fiber.styles.IStyle
     {
         switch(propertyName)
         {
            default:
            {
                return null;
            }
         }
     }
     
     /**
     * 
     * @inheritDoc 
     *  
     */  
     override public function getPropertyValidationFailureMessages(propertyName:String):Array
     {
         switch(propertyName)
         {
            case("en_UK_name"):
            {
                return en_UK_nameValidationFailureMessages;
            }
            case("en_UK_type"):
            {
                return en_UK_typeValidationFailureMessages;
            }
            case("de_AT_name"):
            {
                return de_AT_nameValidationFailureMessages;
            }
            case("de_AT_type"):
            {
                return de_AT_typeValidationFailureMessages;
            }
            case("url_drawing"):
            {
                return url_drawingValidationFailureMessages;
            }
            default:
            {
                return emptyArray;
            }
         }
     }

}

}
